package com.ddc.api;

import com.ddc.api.param.repay.RepayParam;
import com.ddc.api.param.repay.RepayRecordParam;
import com.wang.commons.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@Api("还款api")
@FeignClient(value = "loan",contextId = "RepayApi")
public interface RepayApi {
    //查询还款记录,根据用户的身份证号码和贷款id来确认唯一一条的贷款还款的记录
    @ApiOperation("查询还款记录的接口")
    @PostMapping("repayRecord")
    public Result repayRecord(@RequestBody RepayRecordParam rrp);

    //正常还款
    //根据当前系统时间，用户的身份证号码、贷款id查询出某一笔的待还的金额
    //返回用户的还款金额
    @PostMapping("nomalRepay")
    @ApiOperation("正常还款接口")
    public Result nomalRepay(@RequestBody RepayParam  rp );


    //延迟还款
    //根据当前时间计算延迟还款的滞纳金，采取相关的处理方式
    //根据用户传入的身份证号码，查询出没有完成还款的贷款，根据贷款id查询贷款计划
    @ApiOperation("延迟还款接口")
    @GetMapping("deleay/{userName}")

    public Result deleayRepay(@RequestParam @ApiParam("用户名称")@PathVariable("userName") Integer userName);




}
